package com.kly.user.db.dao.impl;
import com.fqgj.common.base.AbstractBaseMapper;
import com.kly.user.db.dao.TMessageDao;
import com.kly.user.db.entity.TMessageEntity;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
* User: linqu
* Date: 2023-06-26
* Time: 16:49:16.289
*/

@Repository
public class TMessageDaoImpl extends AbstractBaseMapper<TMessageEntity> implements TMessageDao {

    @Override
    public List<TMessageEntity> queryUnReadMessages(String userCode) {
        return this.getSqlSession().selectList(this.getStatement("queryUnReadMessages"), userCode);
    }

    @Override
    public List<TMessageEntity> queryAllMessages(String userCode) {
        return this.getSqlSession().selectList(this.getStatement("queryAllMessages"), userCode);
    }


    @Override
    public Integer queryTotalUnReadMessages(String userCode) {
        return (Integer)this.getSqlSession().selectOne(this.getStatement("queryTotalUnReadMessages"), userCode);
    }

}